Test-Series - programming logic

Test Number 4/15

Q: How many times loop will execute?

#include < stdio.h >
int main()
{
int x,y;
for(x=5;x>=1;x--)
{
for (y=1;y<=x;y++)
printf("%d
",y);
}
} 
A. 15
B. 13
C. 11
D. 10
Solution: The correct answer is:15
Q: How many times tosscall will print?

int main(void)
{
int i;
for(i=0;i<5;i++);
printf("tosscall");
}
A. 1
B. 4
C. Runtime error
D. Compilation error
Solution: The correct answer is:1
Q: Is there any difference int the following declarations?

int fun(int arr[]);

int fun(int arr[2]);
A. yes
B. no
C. wrong question
D. wrong options
Solution: The correct answer is:No
Q: What is recursion?
A. looping
B. a function calls repeatedly
C. function calls itself repeatedly
D. a function calls another function repeatedly
Solution: The correct answer is:
function calls itself repeatedly
Q: What does the following declaration mean?

int (*ptr)[12];
A. ptr is a pointer to an array of 12 integers
B. ptr is an array of 12 integers
C. ptr is an pointer to array
D. ptr is array of pointers to 12 integers
Solution: The correct answer is:
 ptr is a pointer to an array of 12 integers  
Q: The value obtained in the function is given back to the main by using ________ keyword?
A. new
B. static
C. return
D. volatile
Solution: The correct answer is:return
Q: Property which allows to produce different executable for different platforms in C is called?
A. Recursive macros
B. File inclusion
C. Conditional compilation
D. Selective inclusion
Solution: The correct answer is:
Conditional compilation
Q: What will be the output of the following code :

main()
{
extern int iExtern;
iExtern = 20;
printf(%d,iExtern);
}
A. 20
B. warning
C. 2
D. error
Solution: The correct answer is:
Error
Q: What will be the output of following code :

#include.....
int a=12;
main(void)
{
a=0;
printf("%d";a);
}
A. 12
B. 65535
C. 0
D. ERROR – Cannot Override Global variable.
Solution: The correct answer is:0
Q:  What will be the output of following code :

int main()
{
  int a= NULL - true;
  printf("%d",a);
  return 0;
}
A. -1
B. Garbage Value
C. 0
D. Error
Solution: The correct answer is:-1

You Have Score    /10